package com.sky.wsp.spring.boot3.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sky.wsp.spring.boot3.dao.OrgUserMapper;
import com.sky.wsp.spring.boot3.entity.OrgUserEntity;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangshaopeng@talkweb.com.cn
 * @desccription 在此输入描述
 * @date 2024/10/18
 */
@RestController
@RequestMapping("/org-user")
public class OrgUserController {
    @Resource
    private OrgUserMapper orgUserMapper;

    @GetMapping("/page")
    public IPage<OrgUserEntity> list(@RequestParam("current") Integer current, @RequestParam("size") Integer size) {
        IPage<OrgUserEntity> page = new Page<>(current, size);
        LambdaQueryWrapper<OrgUserEntity> query = new LambdaQueryWrapper<OrgUserEntity>();
        query.eq(OrgUserEntity::getTenantId, "defaultTenantId");
        IPage<OrgUserEntity> result = orgUserMapper.selectPage(page, query);
        return result;
    }
}
